import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooUserScoreController } from '../../../controllers';
const uctoouserScoreRouter = new Router();
const userScoreController = new uctooUserScoreController();

uctoouserScoreRouter.post('/add', requireUser, userScoreController.add);
uctoouserScoreRouter.post('/edit', requireUser, rowLevelPermission('uctoo/user_score'), userScoreController.edit);
uctoouserScoreRouter.post('/del', requireUser, rowLevelPermission('uctoo/user_score'), userScoreController.delete);

//For getting userScore with permission control
uctoouserScoreRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/user_score'), userScoreController.getSingle);
uctoouserScoreRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/user_score'), userScoreController.getMany);
uctoouserScoreRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/user_score'), userScoreController.getMany);

//#endregion AutoCreateCode
uctoouserScoreRouter.get('/get', requireUser, userScoreController.getOne);
export default uctoouserScoreRouter;
